
image1 = imread('fig6.tif');
[n,m]=size(image1);
result=zeros(n,m);
left=[1,0,50;0,1,50;0,0,1];
for i=1:n
    for j=1:m
        t=left*[i;j;1];
        if t(1,1)<=m&&t(2,1)<=n&&t(1,1)>=1&&t(2,1)>=1
            result(t(1,1),t(2,1))=image1(i,j);
        end
    end
end
imshow(uint8(result));
